import request from "@/utils/request";
import { stringify } from "qs";

//用户仓库下拉列表
export async function getWarehouseListOp() {
	return request(`/zjf-wms/warehouse/list`);
}

//根据仓库id查询已分拣完成的出库单
export async function getSortingDoneNum(params) {
	return request(`/new-wms/sorting-box/sortingDoneNum?${stringify(params)}`);
}

// 扫码发货唯一码作废状态查询
export async function scanUniqueCodeCancelledInfoQuery(params) {
	return request(`/new-wms/outboundorder/scanUniqueCodeCancelledInfo?${stringify(params)}`, {
		loading: true
	});
}

// 扫码发货
export async function scanUniqueCodeOrSkuCodeOutboundorder(params) {
	return request(`/new-wms/outboundorder/scanUniqueCodeOrSkuCode?${stringify(params)}`, {
		loading: true
	});
}
//快递列表可用快递列表 0：自发可用，1：全部可用
export async function queryExpressList(params) {
	return request(`/blade-logistics/expresskxerp/expressKv?${stringify(params)}`, {
		loading: true
	});
}
// 强制发货
export async function forceOutboundorder(params) {
	return request(`/new-wms/outboundorder/manual-delivery`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 补打面单
export async function reprintOutboundorder(params) {
	return request(`/new-wms/outboundorder/reprint?${stringify(params)}`, {
		loading: true
	});
}
// 获取语音播报设置
export async function getVoiceConfigList() {
	return request(`/new-wms/sortingvoiceconfiguration/getConfigList`, {
		loading: true
	});
}

// 保存或修改语音播报设置
export async function saveOrUpdateVoiceConfig(params) {
	return request(`/new-wms/sortingvoiceconfiguration/saveOrUpdate`, {
		method: "Post",
		data: params,
		loading: true
	});
}
// 查询默认合格证
// export async function queryDefaultTemplate(params) {
// 	return request(`/blade-goods/ecGoodsCofcTemplate/queryDefault?${stringify(params)}`);
// }
export async function queryDefaultTemplate(params) {
	return request(`/blade-goods/foreign/getCoFcTemplateByIds`, {
		method: "Post",
		data: params
	});
}
// 修改打印状态
export async function updatePrint(params) {
	return request(`/new-wms/outboundorder/updatePrint?${stringify(params)}`, {
		loading: true
	});
}
// 唯一码查询物流信息
export async function getWaybillByCode(params) {
	return request(`/new-wms/outboundorder/getWaybillByCode?${stringify(params)}`, {
		loading: true
	});
}
export async function updateLogisticsOp(params) {
	return request(`/new-oms/order/updateLogistics`, {
		method: "post",
		data: params
	});
}
// 拆单发货
export async function openOrderDelivery(params) {
	return request(`/new-wms/outboundorder/openOrderDelivery?${stringify(params)}`, {
		loading: true
	});
}
// 修改快递公司
export async function updateExpressCompany(params) {
	return request(`/new-wms/outboundorder/update-express-company`, {
		method: "post",
		data: params
	});
}
// 根据销售出库单号获取快递单号
export async function getWaybillByOutboundNo(params) {
	return request(`/new-wms/outboundorder/getWaybillByOutboundNo?${stringify(params)}`);
}

//根据销售出库单号获取快递公司
export async function getExpressCompanyByOutboundNoListOp(params) {
	return request(`/new-wms/outboundorder/getExpressCompanyByOutboundNoList`, {
		method: "post",
		data: params,
	});
}

// 强制发货
export async function outboundOrderBatchForce(params) {
	return request(`/new-wms/outboundorder/batchForce`, {
		method: "post",
		data: params,
		loading: true
	});
}

//设置打印机名称
export async function savePrinterName(params) {
  return request(`/new-oms-ec/printTask/setPrinterNames`, {
    method: 'POST',
    data: params,
  });
}

// 获取发货设置
export async function getShippingConfigList() {
	return request(`/new-wms/sortingvoiceconfiguration/getShippingConfigList`, {
		loading: true
	});
}

//获取快麦唯一码打印数据
export async function getKuaiMaiPrint(params) {
	return request(`/new-wms/kuaimai/getKuaiMaiCodePrintList`, {
		method: "post",
		data: params,
	});
}

//通过唯一码获取订单相关的所有唯一码
export async function getUniqueCodeByCode(params) {
	return request(`/new-wms/uniquecodes/getUniqueCodeByCode`, {
		method: "get",
		params: params,
	});
}

// 获取面单连续打印配置
export async function getExpressScanConfigList() {
	return request(`/new-wms/sortingvoiceconfiguration/getExpressScanConfigList`);
}

